using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;

namespace UWBGL_XNA_Lib13
{
	public static class UWB_Utility
	{
		// one instance -- random numbers generated using same seed
		// Otherwise: instantiating multiple new Random per second uses same seed and will return same number
		private static Random randGenerator = new Random(); 

		public const double zeroTolerance = 1.0e-9;

		public static TextBox mEchoTextBox;

		public static void echoToStatusArea(string echoString)
		{
			//if (mEchoTextBox.Created)
			//    mEchoTextBox.Text = echoString;
		}

		// random generators:
		// 0 to 1
		public static float UWB_RandomNumber(float range)
		{
			return range * (float)randGenerator.NextDouble();
		}

		// any range
		public static float UWB_RandomNumber(float minRange, float maxRange)
		{
			float size = maxRange - minRange;
			return minRange + UWB_RandomNumber(size);
		}
	}
}
